class User < Remote
  attr_accessor :password, :password_confirmation
  cattr_accessor :cu
  
  class << self
    def current_user
      self.cu ||= find(:one, :from => :current_user)
    end
  end
  
  def folders
    Folder.find(:all, :from => "/users/#{id.to_s}/folders")
  end
  
  def name
    "#{first_name} #{last_name}"
  end
  alias joined_name name
  
  def password= foo
    self.attributes['password'] = foo
  end
  
  def password_confirmation= foo
    self.attributes['password_confirmation'] = foo
  end
end